package com.sakila.pojo;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.validation.Valid;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sakila.pojo.other.Name;

public class Member implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 6720202035587404468L;
	
	private Integer id;
	private Store store;
	@Valid
	private Name name;
	@Email(regexp=".+@.+\\..+")
	private String email;
	@Valid
	private Address address;
	private Integer active;
	private Date createDate;
	@NotBlank
	private String username;
	@JsonIgnore
	private String password;
	private Date lastUpdate;
	@JsonIgnore
	private Set<Role> roles;
	
	public Member() {
		// TODO Auto-generated constructor stub
	}

	public Member(Integer id) {
		super();
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	public Name getName() {
		return name;
	}

	public void setName(Name name) {
		this.name = name;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	public Integer getActive() {
		return active;
	}

	public void setActive(Integer active) {
		this.active = active;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Date getLastUpdate() {
		return lastUpdate;
	}

	public void setLastUpdate(Date lastUpdate) {
		this.lastUpdate = lastUpdate;
	}
	
	public Set<Role> getRoles() {
		return roles;
	}

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}
}
